package com.example.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.domain.Category;
import com.example.service.CategoryService;
import com.example.mapper.CategoryMapper;
import org.springframework.stereotype.Service;

/**
* @author Administrator
* @description 针对表【category(菜品及套餐分类)】的数据库操作Service实现
* @createDate 2022-04-29 22:09:51
*/
@Service
public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category>
    implements CategoryService{

    @Override
    public IPage<Category> getCategoryListForPage(Integer page, Integer pageSize) {
        Page<Category> categoryPage = new Page<>(page,pageSize);
        Page<Category> page1 = this.page(categoryPage,new LambdaQueryWrapper<Category>()
                .orderByAsc(Category::getType)
                .orderByAsc(Category::getSort));
        return page1;
    }
}




